import React, {Component} from 'react';
import Top from '../../component/top/top';
import FootCon from '../../component/footCon/footCon';
import { setRouterName } from '../../store/public/action';
import { connect } from 'react-redux';

class BaiduMap extends Component {
    componentWillMount(){
        const {dispatch} = this.props;
        dispatch(setRouterName(this.props.location.pathname, this.props.history));
    }

    render() {
        return (
            <div className='baiduMap'>
                <Top></Top>
                <iframe src={"http://map.baidu.com/?newmap=1&ie=utf-8&s=s%26wd%3D" + this.props.location.query.address}
                        frameborder="0" width='100%' height='600px'></iframe>
                <FootCon></FootCon>
            </div>
        )
    }
}


const mapStateToProps = (state) =>{
    let routehistory = state.publics.routehistory;
    let titleName = '';

    return {
        titleName : titleName,
        Tophistory: routehistory
    }

}
export default connect(mapStateToProps)(BaiduMap)